#一般方法，使用圆括号粑key和value对以此放置

%data = ('John Paul', 45, 'Lisa', 30, 'Kumar', 40);

print "\$data{'John Paul'} = $data{'John Paul'}\n";
print "\$data{'Lisa'} = $data{'Lisa'}\n";
print "\$data{'Kumar'} = $data{'Kumar'}\n";

$data{'John Paul'} = 45;
$data{'Lisa'} = 30;
$data{'Kumar'} = 40;

#方法2，直接使用key访问，如果这个key-value还没有存在那么久自动创建
#如果存在了key-value那么就更新value

$mydata{'a'} = 12;
$mydata{'b'} = 22;
$mydata{'c'} = 33;

print %mydata,"\n";
print $mydata{'a'},"\n";

#方法3

%thisdata = ('a' => 1,'b' => 2, 'c' => 3);
print %thisdata,"\n";

%data4 = (-JohnPaul => 45, -Lisa => 30, -Kumar => 40);
$val = $data4{-JohnPaul};
print $val,"\n";